package com.example.ref.delete;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

import com.example.ref.AbstractWhere;
import com.example.ref.Delete;
import com.example.ref.RSQLiteDatabaseHelper;

public  class Where<T> extends AbstractWhere<T>
{

	public Where(Delete<T> statement, String field, int operator, Object value)
			throws Exception {
		super(statement, field, operator, value);
	}

	public Where<T> and(String field, int operator, Object value) throws Exception {
		super._and(field, operator, value);
		return this;
	}
	public Where<T> or(String field, int operator, Object value) throws Exception {
		super._or(field, operator, value);
		return this;
	}

	@Override
	public Integer execute(Context context) {
		return RSQLiteDatabaseHelper.delete(null,statement.getInnerClass(),builder.toString(), context);
	}

	@Override
	public Object execute(SQLiteDatabase database, Context context)
			throws Exception {
		return RSQLiteDatabaseHelper.delete(database,statement.getInnerClass(),builder.toString(), context);
	}

}
